home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / source / uXMLContactSync.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2004-06-25  |  6.4 KB  |  265 lines

  1. unit uXMLContactSync;
  2.  
  3. {
  4. *******************************************************************************
  5. * Descriptions: Automaticly Generated Unit for the XMLFmaSync DOM
  6. * $Source: /cvsroot/fma/fma/uXMLContactSync.pas,v $
  7. * $Locker:  $
  8. *
  9. * Change Log:
  10. * $Log: uXMLContactSync.pas,v $
  11. * Revision 1.3  2004/06/25 18:27:09  lordlarry
  12. * Added this changelog header
  13. *
  14. *
  15. }
  16.  
  17. interface
  18.  
  19. uses xmldom, XMLDoc, XMLIntf;
  20.  
  21. type
  22.  
  23. { Forward Decls }
  24.  
  25.   IXMLFmaSyncType = interface;
  26.   IXMLContactType = interface;
  27.   IXMLFMAType = interface;
  28.   IXMLExternType = interface;
  29.  
  30. { IXMLFmaSyncType }
  31.  
  32.   IXMLFmaSyncType = interface(IXMLNodeCollection)
  33.     ['{CA4B2EEA-C70C-4AB6-B679-E9D7DD9122B9}']
  34.     { Property Accessors }
  35.     function Get_Contact(Index: Integer): IXMLContactType;
  36.     { Methods & Properties }
  37.     function Add: IXMLContactType;
  38.     function Insert(const Index: Integer): IXMLContactType;
  39.     property Contact[Index: Integer]: IXMLContactType read Get_Contact; default;
  40.   end;
  41.  
  42. { IXMLContactType }
  43.  
  44.   IXMLContactType = interface(IXMLNode)
  45.     ['{5A2C5693-BE46-49BE-BA70-FC2AEBD2399A}']
  46.     { Property Accessors }
  47.     function Get_SyncID: Integer;
  48.     function Get_FMA: IXMLFMAType;
  49.     function Get_Extern: IXMLExternType;
  50.     procedure Set_SyncID(Value: Integer);
  51.     { Methods & Properties }
  52.     property SyncID: Integer read Get_SyncID write Set_SyncID;
  53.     property FMA: IXMLFMAType read Get_FMA;
  54.     property Extern: IXMLExternType read Get_Extern;
  55.   end;
  56.  
  57. { IXMLFMAType }
  58.  
  59.   IXMLFMAType = interface(IXMLNode)
  60.     ['{622B347A-E707-4BD1-9A40-249C4BC27DBA}']
  61.     { Property Accessors }
  62.     function Get_ID: Variant;
  63.     function Get_Hash: WideString;
  64.     procedure Set_ID(Value: Variant);
  65.     procedure Set_Hash(Value: WideString);
  66.     { Methods & Properties }
  67.     property ID: Variant read Get_ID write Set_ID;
  68.     property Hash: WideString read Get_Hash write Set_Hash;
  69.   end;
  70.  
  71. { IXMLExternType }
  72.  
  73.   IXMLExternType = interface(IXMLNode)
  74.     ['{8F521746-8EE0-44B2-903D-9B7B038CE01C}']
  75.     { Property Accessors }
  76.     function Get_ID: Variant;
  77.     function Get_Hash: WideString;
  78.     procedure Set_ID(Value: Variant);
  79.     procedure Set_Hash(Value: WideString);
  80.     { Methods & Properties }
  81.     property ID: Variant read Get_ID write Set_ID;
  82.     property Hash: WideString read Get_Hash write Set_Hash;
  83.   end;
  84.  
  85. { Forward Decls }
  86.  
  87.   TXMLFmasyncType = class;
  88.   TXMLContactType = class;
  89.   TXMLFMAType = class;
  90.   TXMLExternType = class;
  91.  
  92. { TXMLFmasyncType }
  93.  
  94.   TXMLFmasyncType = class(TXMLNodeCollection, IXMLFmaSyncType)
  95.   protected
  96.     { IXMLFmaSyncType }
  97.     function Get_Contact(Index: Integer): IXMLContactType;
  98.     function Add: IXMLContactType;
  99.     function Insert(const Index: Integer): IXMLContactType;
  100.   public
  101.     procedure AfterConstruction; override;
  102.   end;
  103.  
  104. { TXMLContactType }
  105.  
  106.   TXMLContactType = class(TXMLNode, IXMLContactType)
  107.   protected
  108.     { IXMLContactType }
  109.     function Get_SyncID: Integer;
  110.     function Get_FMA: IXMLFMAType;
  111.     function Get_Extern: IXMLExternType;
  112.     procedure Set_SyncID(Value: Integer);
  113.   public
  114.     procedure AfterConstruction; override;
  115.   end;
  116.  
  117. { TXMLFMAType }
  118.  
  119.   TXMLFMAType = class(TXMLNode, IXMLFMAType)
  120.   protected
  121.     { IXMLFMAType }
  122.     function Get_ID: Variant;
  123.     function Get_Hash: WideString;
  124.     procedure Set_ID(Value: Variant);
  125.     procedure Set_Hash(Value: WideString);
  126.   end;
  127.  
  128. { TXMLExternType }
  129.  
  130.   TXMLExternType = class(TXMLNode, IXMLExternType)
  131.   protected
  132.     { IXMLExternType }
  133.     function Get_ID: Variant;
  134.     function Get_Hash: WideString;
  135.     procedure Set_ID(Value: Variant);
  136.     procedure Set_Hash(Value: WideString);
  137.   end;
  138.  
  139. { Global Functions }
  140.  
  141. function Getfmasync(Doc: IXMLDocument): IXMLFmaSyncType;
  142. function Loadfmasync(const FileName: WideString): IXMLFmaSyncType;
  143. function Newfmasync: IXMLFmaSyncType;
  144.  
  145. const
  146.   TargetNamespace = '';
  147.  
  148. implementation
  149.  
  150. { Global Functions }
  151.  
  152. function Getfmasync(Doc: IXMLDocument): IXMLFmaSyncType;
  153. begin
  154.   Result := Doc.GetDocBinding('fmasync', TXMLFmasyncType, TargetNamespace) as IXMLFmaSyncType;
  155. end;
  156.  
  157. function Loadfmasync(const FileName: WideString): IXMLFmaSyncType;
  158. begin
  159.   Result := LoadXMLDocument(FileName).GetDocBinding('fmasync', TXMLFmasyncType, TargetNamespace) as IXMLFmaSyncType;
  160. end;
  161.  
  162. function Newfmasync: IXMLFmaSyncType;
  163. begin
  164.   Result := NewXMLDocument.GetDocBinding('fmasync', TXMLFmasyncType, TargetNamespace) as IXMLFmaSyncType;
  165. end;
  166.  
  167. { TXMLFmasyncType }
  168.  
  169. procedure TXMLFmasyncType.AfterConstruction;
  170. begin
  171.   RegisterChildNode('contact', TXMLContactType);
  172.   ItemTag := 'contact';
  173.   ItemInterface := IXMLContactType;
  174.   inherited;
  175. end;
  176.  
  177. function TXMLFmasyncType.Get_Contact(Index: Integer): IXMLContactType;
  178. begin
  179.   Result := List[Index] as IXMLContactType;
  180. end;
  181.  
  182. function TXMLFmasyncType.Add: IXMLContactType;
  183. begin
  184.   Result := AddItem(-1) as IXMLContactType;
  185. end;
  186.  
  187. function TXMLFmasyncType.Insert(const Index: Integer): IXMLContactType;
  188. begin
  189.   Result := AddItem(Index) as IXMLContactType;
  190. end;
  191.  
  192. { TXMLContactType }
  193.  
  194. procedure TXMLContactType.AfterConstruction;
  195. begin
  196.   RegisterChildNode('fma', TXMLFMAType);
  197.   RegisterChildNode('extern', TXMLExternType);
  198.   inherited;
  199. end;
  200.  
  201. function TXMLContactType.Get_SyncID: Integer;
  202. begin
  203.   Result := AttributeNodes['syncid'].NodeValue;
  204. end;
  205.  
  206. procedure TXMLContactType.Set_SyncID(Value: Integer);
  207. begin
  208.   SetAttribute('syncid', Value);
  209. end;
  210.  
  211. function TXMLContactType.Get_FMA: IXMLFMAType;
  212. begin
  213.   Result := ChildNodes['fma'] as IXMLFMAType;
  214. end;
  215.  
  216. function TXMLContactType.Get_Extern: IXMLExternType;
  217. begin
  218.   Result := ChildNodes['extern'] as IXMLExternType;
  219. end;
  220.  
  221. { TXMLFMAType }
  222.  
  223. function TXMLFMAType.Get_ID: Variant;
  224. begin
  225.   Result := AttributeNodes['id'].NodeValue;
  226. end;
  227.  
  228. procedure TXMLFMAType.Set_ID(Value: Variant);
  229. begin
  230.   SetAttribute('id', Value);
  231. end;
  232.  
  233. function TXMLFMAType.Get_Hash: WideString;
  234. begin
  235.   Result := AttributeNodes['hash'].Text;
  236. end;
  237.  
  238. procedure TXMLFMAType.Set_Hash(Value: WideString);
  239. begin
  240.   SetAttribute('hash', Value);
  241. end;
  242.  
  243. { TXMLExternType }
  244.  
  245. function TXMLExternType.Get_ID: Variant;
  246. begin
  247.   Result := AttributeNodes['id'].NodeValue;
  248. end;
  249.  
  250. procedure TXMLExternType.Set_ID(Value: Variant);
  251. begin
  252.   SetAttribute('id', Value);
  253. end;
  254.  
  255. function TXMLExternType.Get_Hash: WideString;
  256. begin
  257.   Result := AttributeNodes['hash'].Text;
  258. end;
  259.  
  260. procedure TXMLExternType.Set_Hash(Value: WideString);
  261. begin
  262.   SetAttribute('hash', Value);
  263. end;
  264.  
  265. end.